<?php

/**
 * Status
 *  
 * @author roy
 * @version 
 */

class Status {
	
	private $default = 1;
	
	public $_data = array(
		array('id' => 1, 'title' => 'completed', 'color' => '#333366'), 
		array('id' => 2, 'title' => 'planned', 'color' => '#666699'),
		array('id' => 3, 'title' => 'tentative', 'color' => '#CCCCCC'),
		array('id' => 4, 'title' => 'milestone', 'color' => '#996699'),
		array('id' => 5, 'title' => 'release', 'color' => '#AA6699')
	);

	/**
	 * @return the color of the given status
	 */
	public function colorOf($id) {
		$id = (int) $id;
		if ($id < 1  || sizeof($this->_data) < $id) {
			$id = $this->default;
		}
		return $this->_data[$id - 1]['color'];		
	}
	
	/**
	 * @return the color of the given status
	 */
	public function titleOf($id) {
		$id = (int) $id;
		if ($id < 1  || sizeof($this->_data) < $id) {
			$id = $this->default;
		}
		return $this->_data[$id - 1]['title'];		
	}
	
	public function statuses() {
		return $this->_data;
	}
}
